Repository navigation
fix(opencode-route-proxy): evaluate target window gates (#3225) - #3245
Conversation
normalizeTarget dropped target window gates, so time-windowed route targets (the background route peak/off-peak chain, opencode#639) were expanded at all hours through the proxy. Preserve the gate at normalization (name or {name, invert:true}), load experimental.model_route_windows, and expand a gated target only while its window is active in its own timezone (daysOfWeek + HH:MM range, start inclusive/end exclusive, overnight wrap), or only while inactive for the invert form. Unknown window names fail closed. OPENCODE_ROUTE_PROXY_NOW_MS pins the evaluation clock for tests/replay.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 44 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Fixes #3225 — the unaddressed Codex P2 from PR #2549.
What
normalizeTargetreduced an object target to its model ref + variant map, discardingwindowgates, and the proxy contained no window handling at all — so time-windowed targets in the checked-in config (thebackgroundroute's peak/off-peak chain) were expanded at all hours.loadConfignow loadsexperimental.model_route_windows.normalizeTargetpreserves the gate:window: "<name>"orwindow: { name, invert: true }.resolveRouteexpands a gated target only while its window is active —{ daysOfWeek, start, end, timezone }evaluated in the window's own timezone, start inclusive / end exclusive, overnight wrap supported — or only while inactive for the invert form.OPENCODE_ROUTE_PROXY_NOW_MSpins the evaluation clock (tests / incident replay); unset = wall clock.Triage decision (recorded on #3225): windows are a LIVE feature — the checked-in config states the opencode#639 clock-gated chain is live and defines the windows — so the proxy side was wrong, not the config.
Tests
node --test bin/opencode-route-proxy.test.mjson the laptop: 11/11 pass (7 existing + 4 new: in-window expansion, out-of-window exclusion, invert form both directions, unknown window fails closed).Queue task 4736 (lane C).
Need help on this PR? Tag
@codesmith-botwith what you need.